﻿@{
    ViewBag.Title = "NoticeUser";
    Layout = "~/Views/Shared/_GridCommonLayout.cshtml";
}

<style>
    /**修正内容不居中*/
    #NoticesMessageModal .modal-body {
        overflow-y: inherit;
    }
    /*修正弹窗不居中*/
    #NoticesMessageModal.modal {
        left: 0;
        margin-left: auto;
        margin-right: auto;
    }
</style>
<!--公告列表  style="display:none"-->
<section id="widget-grid" class="">
    <div class="row">

        <!--Search-->
        <div class="filter-bar">
            <form id="formSearch">
                <div class="lbl glyphicons search" style="cursor: pointer;" data-bind="click: $root.search">
                    <i></i>筛选
                </div>


                <div>
                    <label>标题：</label><div class='input-append'>
                        <input id='txtbSrSTitle' name='txtbSrSTitle' type='text' placeholder='标题' class='input-mini' style='width: 120px;' />
                    </div>
                </div>

                <div>
                    <label>发布者名：</label><div class='input-append'>
                        <input id='txtbSrSUserName' name='txtbSrSSenderName' type='text' placeholder='发送者名' class='input-mini' style='width: 120px;' />
                    </div>
                </div>




                <div class="clearfix">
                </div>
            </form>
        </div>
        <!--/search-->


        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12 sortable-grid ui-sortable">
            <div id="wid-id-2" class="jarviswidget jarviswidget-color-darken jarviswidget-sortable" data-widget-editbutton="false">
                <header>
                    <span class="widget-icon"><i class="fa fa-table"></i></span>
                    <h2>公告列表</h2>
                </header>
                <div style="top: 30px">
                    <div class="jarviswidget-editbox"></div>
                    <div class="widget-body no-padding">
                        <div role="grid" id="bannerGrid" class="dataTables_wrapper form-inline">
                            <div class="table-responsive">

                                <div class="dt-wrapper" style="overflow-y: auto;">


                                    <table class="table table-striped table-bordered table-hover checkboxs">
                                        <!--table head-->
                                        <thead>
                                            <tr>
                                                <th style="width: 1%; display: none">
                                                    <input type="checkbox" value="0" />
                                                </th>
                                                <!-- ko foreach: headers -->
                                                <th data-bind="style: { width: width }" class="left">
                                                    <a href="#" data-bind="text: displayText@*, click: $root.sort*@" style="color: black"></a>
                                                    <i class="icon-circle-arrow-up" data-bind="visible: value == $root.orderBy() && $root.isAsc()"></i>
                                                    <i class="icon-circle-arrow-down" data-bind="visible: value == $root.orderBy() && !$root.isAsc()"></i>
                                                </th>
                                                <!-- /ko -->
                                            </tr>
                                        </thead>
                                        <!--/table head-->
                                        <!--table body(Notice list)-->
                                        <tbody data-bind="foreach: recordSet">
                                            <tr class="selectable" data-bind="click: $root.showUpdateModal">
                                                <td class="left" style="display: none">
                                                    <input type="checkbox" name="userSelector" data-bind="value: Id" />
                                                    <input type="hidden" data-bind="value: Id, attr: { id: Id }" />
                                                </td>

                                                <td class="left" style="width: 70%"><u data-bind='text: STitle' style="cursor:pointer;"></u></td>
                                                <td class="left" style="width: 15%"><strong data-bind='text: Tms.formatDate(DSendtime)'></strong></td>



                                                <td class="left" style="width: 14%"><strong data-bind='text: SSenderName'></strong></td>


                                            </tr>
                                        </tbody>
                                        <!--/table body( Notice list)-->

                                    </table>

                                </div>
                                <!-- 分页 -->
                                <ul class="pagination pagination-alt">
                                    <li>
                                        <a data-bind="click: firstPage"><i class="fa fa-fast-backward "></i></a>
                                    </li>
                                    <li>
                                        <a data-bind="click: prevPage"><i class="fa  fa-backward  "></i></a>
                                    </li>
                                    <li>
                                        <a>
                                            <input id="toPage" type="text" data-bind="value: pageIndex, event: { change: $root.changePageIndex }" style="width: 25px;" />
                                            /共<span data-bind="html: totalPages"></span>页 
                                        </a>
                                    </li>
                                    <li>
                                        <a data-bind="click: nextPage"><i class="fa fa-forward "></i></a>
                                    </li>
                                    <li>
                                        <a data-bind="click: lastPage"><i class="fa fa-fast-forward "></i></a>
                                    </li>
                                </ul>

                                <div class="dt-top-row total  ">
                                    当前记录共：<span data-bind="html: totalCount"></span>条
                                </div>
                                <!--end 分页-->
                            </div>
                        </div>
                    </div>

                </div>
            </div>


        </article>
    </div>
</section>
<!--end 公告列表-->


<!--公告的详细信息-->

<div id="NoticesMessageModal" class="modal fade" id="ProviderMessageModal" tabindex="-1" role="dialog"
    aria-labelledby="NoticesMessageModalLabel" aria-hidden="true">
    <div class="modal-content">
        <div class="modal-header" style="height: 30px">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                <i class="fa fa-times "></i>
            </button>
        </div>

        <div class="modal-body " data-bind="with: NodeValue" style="background-color: white; height: 400px;">
            <input type='hidden' id='txtbID' name='txtbID' />
            <!--公告标题-->
            <div class="row  center " style="height: 30px">
                <label class="font-md txt-color-greenDark" data-bind="text: STitle"></label>

                <hr style="margin-top: -5px" />
            </div>
            <!--end 公告标题-->


            <!-- 公告发布人姓名及发布时间 -->
            <div class="row" style="margin-top: 3px">
                <div style="float: right">
                    <!--发件人姓名 -->
                    <span>
                        <label>
                            <label class="txt-color-blueDark">发件人:</label>&nbsp&nbsp<strong data-bind="text: SSenderName"></strong></label>
                        <!-- 发件时间 -->
                        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                            <label>
                                <label class="txt-color-blueDark">发布时间:</label>&nbsp&nbsp<i data-bind="text:Tms.formatDate( DSendtime)"></i></label>
                    </span>
                </div>
            </div>
            <!-- end  公告发布人姓名及发布时间 -->

            <!--公告内容-->
            <div class="row" style="border: solid 1px #92a761; height: 300px;">
                <p class="message" data-bind="html: SContent" />
            </div>
            <!--end 公告内容-->
        </div>

        <div class="modal-footer " style="margin-top: 0px;">
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">关闭</button>
        </div>
    </div>
    <!--end div content-->
</div>
<!-- end  公告的详细信息-->






@section script{
    <script type="text/javascript" charset="utf-8" src="~/Scripts/customJS/commonHelper.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/jquery.validate-vsdoc.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/js/ZjbCommon.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/customJS/commonHelper.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/customJS/gridCommon.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/ueditor/ueditor.all.js"></script>

    <script type="text/javascript">
        pageSetUp();

        var gdViewModel;
        $(function () {
            var options = {

                tableMaskElement: $("#bannerGrid"),//  tableId  by zjb
                pageSize: 10, //分页大小
                hidId: $("#txtbID"),

                dialogId: "NoticesMessageModal", //添加对话框

                //节点数据
                NodeValue: ko.observable({

                    SSenderNo: '',
                    SSenderName: '',
                    STitle: '',
                    DSendtime: new Date(),
                    INoticesType: '',
                    SSendIp: '',
                    SContent: '',
                    IIsRead: '',

                }),


                //用户列表Grid头部列名称
                headers: [
                { displayText: '标题', value: 'STitle', width: 'auto' },
                { displayText: '发布时间', value: 'DSendtime', width: 'auto' },
                { displayText: '发布者姓名', value: 'SSenderName', width: 'auto' }

                ],

                //默认的排序方式
                defaultOrderBy: "Id",
                //用户查询URL
                dataQueryUrlAccessor: function () {
                    return "/api/NoticesExt/Search";
                },

                //
                showDetailEnd: function (data) {
                },

                dataNodeSelect: function (id) {
                    //return "/api/Notice/get/" + id;
                    return "/api/NoticesExt/GetNotices/" + id;
                }

                , initEd: function () {

                }

            };

            gdViewModel = new gridViewModel(options);
            gdViewModel.init();

            ko.applyBindings(gdViewModel);


        });

    </script>
}





